package com.hnichr.ump.common.salon.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hnichr.ump.common.entity.UmpEntity;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "t_salon_applicants")
@Schema(description = "沙龙报名者表")
public class Applicants extends UmpEntity {
    @Id
    @Generator
    @Column(name = "ID_", updatable = false,length = 64)
    @Schema(description = "ID")
    private String id;

    @Schema(description = "沙龙ID")
    @Column(name = "SALON_ID_",length = 64)
    private String salonId;

    @Schema(description = "手机号")
    @Column(name = "MOBILE_",length = 20)
    private String mobile;

    @Schema(description = "姓名")
    @Column(name = "NAME_",length = 64)
    private String name;

    @Schema(description = "性别")
    @Column(name = "SEX_",length = 10)
    private String sex;

    @Schema(description = "出生年月")
    @Column(name = "BIRTH_MONTH_")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    private Date birthMonth;

    @Schema(description = "专业")
    @Column(name = "SPECIALITY_")
    private String speciality;

    @Schema(description = "学位")
    @Column(name = "DEGREE_")
    private String degree;

    @Schema(description = "职称")
    @Column(name = "TITLE_")
    private String title;

    @Schema(description = "毕业学校")
    @Column(name = "GRADUATION_")
    private String graduation;

    @Schema(description = "工作单位")
    @Column(name = "WORK_UNIT_")
    private String workUnit;

    @Schema(description = "审核状态 0-未审核  1-审核通过 2-审核未通过")
    @Column(name = "STATUS_",length = 10)
    @Dict(dicCode = "APPROVAL_STATUS")
    private String status="0";

    @Schema(description = "审核时间")
    @Column(name = "AUDIT_TIME_")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date auditTime;

    @Schema(description = "签到状态  0-未签到  1-签到")
    @Column(name = "SIGN_IN_",length = 10)
    @Dict(dicCode = "SIGN_IN")
    private String signIn="0";

    @Schema(description = "签到时间")
    @Column(name = "SIGN_IN_TIME_")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date signInTime;

    @Transient
    private SalonInfo salonInfo;
}
